fn is_prime(n: u64) -> bool {
    if n <= 1 {
        return false;
    }
    if n <= 3 {
        return true;
    }
    if n % 2 == 0 || n % 3 == 0 {
        return false;
    }
    let mut i = 5;
    while i * i <= n {
        if n % i == 0 || n % (i + 2) == 0 {
            return false;
        }
        i += 6;
    }
    return true;
}

pub fn goldbach_conjecture() -> u64 {
    let mut n = 3;
    let mut count = 0;
    let mut sum = 0;
    while count < 2 {
        if !is_prime(n) {
            let mut can_represent = false;
            let max_k = ((n / 2) as f64).sqrt() as u64;
            for k in 0..=max_k {
                let p = n - 2 * (k * k);
                if p > 1 && is_prime(p) {
                    can_represent = true;
                    break;
                }
            }
            if !can_represent {
                sum += n;
                count += 1;
            }
        }
        n += 2;
    }
    return sum;
}
